package com.myk.game.gobangchess.expand.bwantispace;


/**
 * 公共棋子基类
 */
public abstract class BasePiece {

    protected Game game;
    protected String name;
    protected int row;
    protected int col;

    public BasePiece(Game game, String name, int row, int col) {
        this.game = game;
        this.name = name;
        this.row = row;
        this.col = col;
    }

    /**
     * 获取坐标数组封装
     */
    public int[] getPosition() {
        return new int[]{row, col};
    }

    /**
     * 获取坐标索引
     */
    public Integer getIndex() {
        return game.helper.room.getIndex(row, col);
    }

    /**
     * 自定义渲染
     */
    public abstract void renderSelf();
}